<template>
	<!-- 左边侧边 -->
	<view>
		<view class="content">
			<scroll-view style="width: 100%; height: 100%;" scroll-y="true">
				<block v-for="(item,index) in content" :key="item">
					<view class=" text_1" @tap="select(index,item.goods)"
						:style="{'background-color':select_index==index?' #ffffff':''}">
						<image class="left_img" :src="item.image" mode=""></image>
						<view class="">
							{{item.name}}
						</view>
					</view>
				</block>
				<view class="text_1">
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "orderlist",
		props: {
			content: {
				type: Array,
				default: [],
				required: true
			},
			index: {
				type: Number
			}
		},
		data() {
			return {
				select_index: 0
			};
		},
		watch: {
			index: function(vlo, rol) {
				this.select_index = 0
			}
		},
		methods: {
			select(index, goods) {
				this.select_index = index
				this.$emit('aid_mgs', goods, index)
			}
		}
	}
</script>

<style lang="scss">
	.content {
		width: 190rpx;
		height: 1200rpx;
		background: #F4F8F9;
		border-radius: 0rpx 18rpx 0rpx 0rpx;
		position: fixed;

		.text_1 {
			width: 100%;
			padding: 30rpx 8rpx;
			font-size: 24rpx;
			font-weight: 400;
			color: #87888B;
			text-align: center;
			box-sizing: border-box;

		}

		.left_img {
			width: 36rpx;
			height: 36rpx;
			border-radius: 10rpx;
			margin-right: 4rpx;
			margin-bottom: 10rpx;
		}
	}
</style>